[Code Update - Chapter 13] Code update for MP Reactive Messaging 3.0.1#75
Open
ttelang wants to merge 1 commit into
Open
[Code Update - Chapter 13] Code update for MP Reactive Messaging 3.0.1#75ttelang wants to merge 1 commit into
ttelang wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This pull request adds code examples for Chapter 13 of the MicroProfile tutorial, demonstrating practical implementation of MicroProfile Reactive Messaging 3.0.1 in a multi-service e-commerce application.
Changes
New Code Examples
Order Service (
code/chapter13/order/)CREATED→PAID→PROCESSING→SHIPPED→DELIVEREDOrderServicewith transaction management and event emissionOrderStatusEventHandlerto consume payment authorization eventsNotificationServicefor order status change notificationsPayment Service (
code/chapter13/payment/)PaymentRequestHandlerfor consumingorder-createdevents and emittingpayment-authorizedProductClient- Basic REST client with exception mappingProductClientWithFilters- Advanced client with authentication, correlation IDs, and logging filtersProductJakartaRestClient- Low-level Jakarta REST client using ClientBuilderAPI Endpoints
Order Management:
GET /api/orders- List all ordersGET /api/orders/{id}- Get order by IDGET /api/orders/user/{userId}- Get user's ordersGET /api/orders/status/{status}- Filter by statusPOST /api/orders- Create new orderPUT /api/orders/{id}- Update orderPATCH /api/orders/{id}/status/{status}- Update statusDELETE /api/orders/{id}- Delete orderOrder Items:
GET /api/orderItems/{id}- Get itemGET /api/orderItems/order/{orderId}- Get items for orderPOST /api/orderItems/order/{orderId}- Add itemPUT /api/orderItems/{id}- Update itemDELETE /api/orderItems/{id}- Remove itemConfiguration
Architecture Highlights
Hybrid REST + Reactive Messaging Pattern:
Event-Driven Workflow:
order-createdeventpayment-authorizedorpayment-failedpayment-authorizedand emits reservation outcomesorder-status-eventsfor downstream consumersChannel Definitions
order-created- Published by Order Service, consumed by Payment Servicepayment-authorized- Published by Payment Service, consumed by Order/Inventory Servicespayment-failed- Published by Payment Service, consumed by Order Serviceinventory-reserved- Published by Inventory Service, consumed by Shipment/Order Servicesinventory-rejected- Published by Inventory Service, consumed by Order Serviceshipment-created,shipment-dispatched,shipment-delivered- Shipment lifecycle eventsDesign Concepts Demonstrated
Testing & Documentation